package head.first.model.factory.demo1;

/**
 * Created by yiyongyao on 2018/2/28.
 * 纽约批萨店 工厂bean
 */
public class NYPizzaStore extends  PizzaStore {

    @Override
    protected Pizza createPizza(String type) {
        //添加奶油
        if (type.equals("cheese")) {
            return new NYStyleCheesePizza();
        } else if (type.equals("cream")) {
            return new ChicagoStyleCheesePizza();
        }
        return null;
    }
}
